package PracticeRC;

import java.util.concurrent.TimeUnit;

import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;

public class PracticeSelenium {

	@Before
	
	public void beforetest() {
		
		//I want to open redfin website and test if the price matches, if the font matches, if the zip code matches, 
		
		
		//I want to open the url for that I need to have the webdriver first
		WebDriver myd = new FirefoxDriver();
		
		myd.navigate().to("http://www.redfin.com/");
		//I need to wait for a few seconds.
		myd.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
		myd.findElement(By.xpath("//input[@id = 'redfin_search_widget_LocationAutocompleteInputBox_0']")).sendKeys("94536");
		//I need to select from the drop down list.
		Select myp = new Select(myd.findElement(By.xpath("//select[@title='Minimum price']")));
		myp.selectByValue("200000");
		Select myo = new Select(myd.findElement(By.xpath("//select[@title='Maximum price']")));
		myo.selectByValue("900000");
		Select myq = new Select(myd.findElement(By.xpath("//select[@name='num_beds']")));
		myq.selectByValue("2");
		Select myr = new Select(myd.findElement(By.xpath("//select[@name='num_baths']")));
		myr.selectByValue("2.0");
		myd.findElement(By.xpath("//input[@name='wideSubmit']")).click();
		//myd.findElement(By.xpath(xpathExpression))
		
		
		
	}
	
	@Test
	   public void attest() {
		System.out.println("print this");
		
	}
	
	
	
}
